﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using ZombZomb.GameObjects;

namespace ProjetPlatformer.gameElements
{
    public class DrawableGameElement : GameElement, IFocusable
    {

        

        protected Vector2 velocity;

        protected Texture2D image;
        
        protected GameSprite sprite;


        public DrawableGameElement(Game game, SpriteBatch sb, ContentManager cm) : base(game,sb,cm)
        {
            
            image = cm.Load<Texture2D>("carre");
            this.bBox.Width = image.Width;
            this.bBox.Height = image.Height;
            sprite = new GameSprite(image, this.position, true);
        }

        public DrawableGameElement(Game game, SpriteBatch sb, ContentManager cm, int decalageX, int decalageY) : this(game,sb,cm)
        {
            position.X += decalageX;
            position.Y += decalageY;
            bBox = new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y);
        }


        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            base.Draw(gameTime);
            spriteBatch.Draw(image, position, Color.Beige);
        }

    }
}
